From 6055524e120bae359c1bb427cbca5b9a345bad17 Mon Sep 17 00:00:00 2001 From: "smh22@labyrinth.cl.cam.ac.uk" Date: Wed, 5 Nov 2003 13:50:28 +0000 Subject: [PATCH] bitkeeper revision 1.563 (3fa90024LzzVnnkZsqlSu4CqEMBe_Q) fix for scsi --- xen/drivers/block/xen_block.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/xen/drivers/block/xen_block.c b/xen/drivers/block/xen_block.c index 97f51e02f1..4e0f422ae3 100644 --- a/xen/drivers/block/xen_block.c +++ b/xen/drivers/block/xen_block.c @@ -536,15 +536,20 @@ static void dispatch_rw_block_io(struct task_struct *p, int index) rc = vbd_translate(&phys_seg[nr_psegs], &new_segs, p, operation); /* If it fails we bail (unless the caller is priv => has raw access) */ - if(rc && !IS_PRIV(p)) { - printk("access denied: attempted %s of [%ld,%ld] on dev=%04x\n", - operation == READ ? "read" : "write", - req->sector_number + tot_sects, - req->sector_number + tot_sects + nr_sects, - req->device); - goto bad_descriptor; + if(rc) { + if(!IS_PRIV(p)) { + printk("access denied: %s of [%ld,%ld] on dev=%04x\n", + operation == READ ? "read" : "write", + req->sector_number + tot_sects, + req->sector_number + tot_sects + nr_sects, + req->device); + goto bad_descriptor; + } + + /* SMH: skanky hack; clear any 'partition' info in device */ + phys_seg[nr_psegs].dev = req->device & 0xFFF0; } - + nr_psegs += new_segs; if ( nr_psegs >= (MAX_BLK_SEGS*2) ) BUG(); } -- 2.30.2